import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        redirect: "/home",
        component: () => import("../views/layout/index.vue"),
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import("../views/layout/home/home.vue")
            },
            {
                path: '/musiclib',
                name: 'musiclib',
                component: () => import("../views/layout/musiclib/musiclib.vue")
            },

            {
                path: '/video',
                name: 'video',
                component: () => import("../views/layout/video/video.vue")
            },

            {
                path: '/songlist',
                name: 'songlist',
                component: () => import("../views/layout/songlist/songlist.vue")
            },
            {
                path: '/radio',
                name: 'radio',
                component: () => import("../views/layout/radio/radio.vue")
            },
            {
                path: '/movie',
                name: 'movie',
                component: () => import("../views/layout/movie/movie.vue")
            },
            {
                path: "/PlaylistDetail/:id",
                name: 'PlaylistDetail',
                component: () => import("../components/music-table.vue")
            },
            {
                path: "/movieDetail/:id",
                name: 'movieDetail',
                component: () => import("../components/movieDetails")
            }
        ]
    },

]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})
// router.beforeEach((to,from,next)=>{
//     if(){
//
//     }
// })
export default router

